from django.db import models

# Create your models here.

class DemoTable(models.Model):

    class State(models.TextChoices):
        PROGRESS = 'pr','progress'
        FINISHED = 'fi', 'finished'
        ERROR    = 'er', 'error'
    #id
    uuid = models.UUIDField(primary_key=True,verbose_name='消息的uuid')
    req = models.TextField(verbose_name='问题是什么')
    ans = models.TextField(null=True,verbose_name='答案是什么') # first null;
    state = models.CharField(max_length=2,choices=State.choices, verbose_name='当前问题状态',default=State.PROGRESS)

    #ip
    ip = models.GenericIPAddressField(verbose_name='发问题的IP',default='0.0.0.0')

